package com.dq.repository.service;

import com.dq.domain.service.ServiceProjectCategory;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author cf
 * 岗位
 */
public interface ServiceProjectCategoryRepository extends JpaRepository<ServiceProjectCategory, Long> {

    /**
     * 根据岗位名称获取
     * @param deleted
     * @param postName
     * @return
     */
    List<ServiceProjectCategory> findByDeletedAndCategoryName(Boolean deleted, String postName);

    /**
     * id Jihe
     * @param ids
     * @return
     */
    List<ServiceProjectCategory> findByIdIn(List<Long> ids);

    /**
     *根据父对象查询子对象集合
     * @param serviceProjectCategory
     * @return
     */
    List<ServiceProjectCategory> findByParentOrderBySortNoAsc(ServiceProjectCategory serviceProjectCategory);

    /**
     * 根据父对象为null查询子对象集合
     * @return
     */
    List<ServiceProjectCategory> findByParentIsNullOrderBySortNoAsc();

    List<ServiceProjectCategory> findByParentAndDeletedFalse(ServiceProjectCategory serviceProjectCategory);
    List<ServiceProjectCategory> findByParentInAndDeletedFalse(List<ServiceProjectCategory> serviceProjectCategorys);

}
